/**
 *
 *
 * */


function Factory(type, text) {
    this.content = text
    if(this instanceof Factory){
        return this[type](text)
    }else {
        return new Father(type, text)
    }
}


Factory.prototype = {
    javascript:function (content){
        console.log(content)
    },
    java:function (){
        // do different code
        console.log('java instance !!!!!')
    }
}


const java = new Factory('java','这是一个java 实例')

